.container {
  height: 100px;
  border: 1px solid #c3c3c3;
  display: flex;
}
.red, .blue {
  flex-shrink: 1;
  flex-basis: 300px;
}

.red {
  background-color: coral;
}

.blue {
  background-color: lightskyblue;
  animation: shrink 5s infinite;
}

@keyframes shrink {
  50% {
    flex-shrink: 8;
  }
}